#ifndef _COMM_PROTOCOL_H_
#define _COMM_PROTOCOL_H_

#include "stdint.h"
#include "ProtocolDefine.h"
#ifdef __cplusplus
extern "C" {
#endif
	

#define UART_BUFFER_SIZE (PROTOCOL_MAX_SIZE * 4)    //协议缓冲区大小 



typedef enum
{
    enumParseState_WaitHead = 0,                         //等待协议头
    enumParseState_WaitVer,                              //等待版本
    enumParseState_WaitTotalLen,                         //等待帧长度
    enumParseState_WaitCrc1,                             //等待CRC1
    enumParseState_WaitCmd,                              //等待命令
    //enumParseState_WaitDataLen,                          //等待数据长度2
    enumParseState_WaitData,                             //等待数据
    enumParseState_Complete,                             //完成解析
}ProtocolParseState;


void CommProtocol_Init(void);

void SendMessage(uint8_t nCmd, uint8_t *pContent, uint8_t nContentLen);

#ifdef __cplusplus
}
#endif  


#endif //_COMM_PROTOCOL_H_


